<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>{:$page_info['title']}</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="author" content="yinqi">
<link href="__STATIC__/admin/css/bootstrap.min.css" rel="stylesheet">
<link href="__STATIC__/admin/css/materialdesignicons.min.css" rel="stylesheet">
<link href="__STATIC__/admin/css/style.min.css" rel="stylesheet">

<link href="__STATIC__/common/select2/select2.css" rel="stylesheet">
<link href="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet">

<link href="__STATIC__/admin/css/cch.css" rel="stylesheet">
</head>
  
<body>
<div class="container-fluid p-t-15">
  
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-toolbar clearfix">
          <form class="pull-right search-bar" method="get" action="{:url($page_info['action'])}" role="form">
            {include file="html/search" /}
          
          </form>
          <div class="toolbar-btn-action">
            <a class="btn btn-primary m-r-5" href="{:url('save')}"><i class="mdi mdi-cash-usd"></i> 充值</a>
            <a class="btn btn-success m-r-5 search_btn" href="javascript:void(0)"><i class="mdi mdi-magnify"></i> 搜索</a>
          </div>
        </div>
        <div class="card-body">
          
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
                <tr>
                    <th>充值订单号</th>
                    <th>充值金额</th>
                    <th>状态</th>
                    <th class="timeTd">创建时间</th>
                    <th class="timeTd">完成时间</th>
                    <th class="operateTd">操作</th>
                </tr>
              </thead>
              <tbody>
                <?php if (empty($list['data'])): ?>
                    <tr><td colspan="100" class="text-center">暂无数据</td></tr>
                <?php else: ?>
                    <?php foreach ($list['data'] as $k => $vo): ?>
                    <tr>
                        <td>{:$vo['recharge_sn']}</td>
                        <td>{:$vo['amount']}</td>
                        <td>{:showColorSpan($model->getStatusCn($vo['status']),$vo['status'],$model->getStatusColor())}</td>
                        <td>{:timeDef($vo['ctime'])}</td>
                        <td>{:timeDef($vo['utime'])}</td>
                        <td class="text-center">
                            <div class="btn-group">
                                <?php if ($vo['status'] == 0): ?>
                                    <a href="javascript:void(0)" data-id="{:$vo['id']}" class="btn btn-xs btn-default pay_btn" data-toggle="tooltip" title="支付"><i class="mdi mdi-cash-usd"></i></a>
                                    <a href="{:url('cancel',['id'=>$vo['id']])}" class="btn btn-xs btn-default cancel_btn" data-toggle="tooltip" title="取消"><i class="mdi mdi-close-circle"></i></a>
                                <?php endif ?>
                            </div>
                        </td>
                    </tr>
                    <?php endforeach ?>
                <?php endif ?>
              </tbody>
            </table>
          </div>


          {$page|raw}
 
        </div>
      </div>
    </div>
    
  </div>
  
</div>

<script type="text/javascript" src="__STATIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/main.min.js"></script>

<!-- 时间选择器 -->
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__STATIC__/admin/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>

<script src="__STATIC__/common/select2/select2.min.js"></script><!-- 下拉搜索 -->

<script type="text/javascript" src="__STATIC__/admin/js/lyear-loading.js"></script><!-- loading -->
<script type="text/javascript" src="__STATIC__/admin/js/cch.js"></script>

<link rel="stylesheet" href="__STATIC__/admin/js/jconfirm/jquery-confirm.min.css">
<script src="__STATIC__/admin/js/jconfirm/jquery-confirm.min.js"></script>
</body>
<script type="text/javascript">
    $(".pay_btn").on('click',function(){
        $.confirm({
            title: '支付结果',
            content: '充值订单是否支付成功',
            type: 'blue',
            typeAnimated: true,
            buttons: {
                tryAgain: {
                    text: '成功',
                    btnClass: 'btn-green',
                    action: function(){
                        location.reload();
                    }
                },
                close: {
                    text: '关闭'
                }
            }
        });
        var recharge_id = $(this).attr('data-id');
        window.open('{:url("alipay/recharge",[],"")}?recharge_id='+recharge_id);
    });
</script>
</html>